<include file="Public:header" /> 
<link href="__APP__/statics/css/picview.css" rel="stylesheet" type="text/css"  charset="utf-8"/>
<link href="__APP__/statics/jquery-ui/css/ui-lightness/jquery-ui-1.9.2.custom.css" rel="stylesheet">
<style type="text/css">
body{font-size:13px;font-family:"微软雅黑";}
.goods{width:1200px;height:400px;border:0px;	margin:0 auto;z-index:99;margin-top:15px;}
.sgood{width:730px;height:360px;border-left:1px dotted;float:left;margin-left:10px;}
.title{max-height:60px;border-bottom:1px dotted;margin-left:10px;font-size:17px;font-weight:bold;overflow:hidden}
.price{margin-top:20px;font-size:13px;margin-left:10px;border-bottom:1px dotted;}
.price li{text-decoration:none;height:30px;}
.prop{margin-left:10px;}
.poo{width:700px;}
.poo span{display:block;float:left;}
.buy_zone{width:500px;border:1px solid #E7DBB1;padding:5px;margin-top:5px;background-color:#FFFEE6;}
.buy_zone:hover{border:1px solid #FF9900;}
.goods_num{margin-top:5px;margin-left:20px;width:250px;}
.buy{margin-top:10px;margin-left:20px;z-index:99}
/*规格选择*/
.catt a {border:#c8c9cd 1px solid;text-align:center;background-color:#fff;margin-left:5px;margin-top:6px;padding-left:10px;padding-right:10px;display:block;white-space:nowrap;color:#000;text-decoration:none;float:left;}
.catt a:hover {border:#ff6701 2px solid;margin:-1px;margin-left:4px;margin-top:5px;}
.catt a:focus {outline-style:none;}
.catt .cattsel {border:#ff6701 2px solid;margin:-1px;background:url("__APP__/statics/choose_bg.jpg") no-repeat bottom right;margin-left:4px;margin-top:5px;}
.catt .cattsel a:hover {border:#ff6701 2px solid;margin:-1px;background:url("__APP__/statics/choose_bg.jpg") no-repeat bottom right;}

.tixing{position:absolute;height:30px;margin-top:-40px;margin-left:400px;color:red;display:none;font-weight:bold;}
/*规格选择end*/
.clear{clear:both}
/*商品详细描述start*/
.content{width:1200px;margin:0 auto;margin-top:0px;}
#intro-left{width:210px;margin-right:0px;float:left;border:0px solid #dedede;}
.other_goods{width:210px;border:1px solid #dedede;}
.ads{width:210px;margin-top:10px;border:0px solid #dedede;}
#intro{width:980px;float:right;}
.com{width:980px;float:right;}
#title{height:25px;line-height:25px;padding:5px;background-color:#F7F7F7;border-bottom:1px solid #dedede;}
#tuijian{width:200px;margin:0 auto;text-align:center;border-bottom:1px dotted #dedede;margin-bottom:-1px;}

.floor_hot{padding:5px;width:195px;height:80px;border-bottom:1px dashed #dedede}
.floor_hot span{float:left}
.hot_title{max-height:36px;width:125px;overflow:hidden;margin-left:10px}
.renqi{margin-left:10px;color:#99cc00}
#price{text-align:left;color:#E4393C;font-size:14px;font-family:'微软雅黑';font-weight:bold;margin-left:15px;}

#tabs3 td{padding:10px}
/*分页*/
.list-page{width:960px;float:right;text-align:right;margin-right:20px;margin-top:10px;}
.page2{height:20px;width:20px;border:1px solid #FF5500; text-align:center;line-height:20px;display:inline-block;color:#0066CC;cursor:pointer;}
.page2:hover{color:#0066CC}
.current{height:20px;width:20px;border:1px solid #FF5500; text-align:center;line-height:20px;color:#FF0000;font-weight:bold;background:#FFEEE5;display:inline-block;cursor:pointer;}
.fan{height:20px;width:50px;border:1px solid #FF5500; text-align:center;line-height:20px;color:#FF0000;background:#FFEEE5;display:inline-block;cursor:pointer;}
</style>

<script type="text/javascript" src="__APP__/statics/js/picview.js"></script>

<input type="text" id="good_id" style="display:none" value="{$goods.goods_id}">
<input type="text" id="choose_id" style="display:none" value="{$product_id}">

<div class="goods">
<!--左边start-->
     <div class="preview" style="float:left;">
		<div class="smallImg">
			<div class="scrollbutton smallImgUp disabled"></div>
			<div id="imageMenu">
				<ul>
<volist name="pic" id="pic">
					<li><img src="__APP__/{$pic.s_pic}" width="60" height="60" alt="洋妞"/></li>
</volist>
				</ul>
			</div>
			<div class="scrollbutton smallImgDown"></div>
		</div><!--smallImg end-->
	
		<div id="vertical" class="bigImg">
<if condition="$goods.m_pic eq ''">
         <img src="__APP__/statics/none.jpg" alt="" id="midimg" />
<else/>
		<img src="__APP__/{$goods.m_pic}" alt="" id="midimg" />
</if>
			<div style="display:none;" id="winSelector"></div>
		</div><!--bigImg end-->
		
		<div id="bigView" style="display:none;"><img height="800px" width="800px" alt="" src="" /></div>
		
	</div><!--preview左边 end-->

<!--右边-->
	<div class="sgood">
	   <div class="title">{$goods.goods_name}<br>
		  <font size="2" color="red">{$goods.s_intro}</font>
	  </div>
	  <div class="price">
	     <li>市场价：<strike><if condition="$goods.market_price eq 0.00"><php>echo $goods['price']*1.2;</php><else/>{$goods.market_price}</if></strike></li>
		 <li>销售价：<font size="5" color="red"><span id="n_price">{$goods.price}</span></font></li>
		 <!--<li>品&nbsp;&nbsp;&nbsp;牌：<if condition="$brand.brand_name neq ''">{$brand.brand_name}<else/>无</if></li>-->
		 <li>单&nbsp;&nbsp;&nbsp;位：<if condition="$goods.unit neq ''">{$goods.unit}<else/>无</if></li>
		 <li>重&nbsp;&nbsp;&nbsp;量：<if condition="$goods.weight neq ''">{$goods.weight} g<else/>无</if></li>
		 <li>配&nbsp;&nbsp;&nbsp;送：由<font color='red'>蚂蚁街</font>为您<font color='red'>免费配送</font>,并提供售后服务</li>
	  </div>
 
     <div class="prop">
<!--规格1-->
       <div class="poo">
	   <span style="margin-top:6px;">{$prop1_n}</span>
	    <span class="catt">
<volist name="prop1" id="prop1">
          <a  onclick="changeAtt(this)" href="javascript:;">{$prop1}<input style="display:none" name="guige1" id="guige1" type="radio" value="{$prop1}"/></a>
</volist>
       </span>
	   </div>
	   <div class="clear"></div>
<!--规格2-->
      <div class="poo">
	   <span style="margin-top:6px;">{$prop2_n}</span>
	    <span class="catt">
<volist name="prop2" id="prop2">
          <a  onclick="changeAtt(this)" href="javascript:;">{$prop2}<input style="display:none" name="guige2" id="guige2" type="radio" value="{$prop2}"/></a>
</volist>
       </span>
	  </div>
	  <div class="tixing"> < 选择规格</div>
	  <div class="clear"></div>
	  
	  <!--prop结束-->
	  <div class="buy_zone">
	    <div id="get_prop" style="margin-left:20px;"><font color="red"><span id="a_prop"></span></font></div>
		<div class="goods_num">
			购买数量：
			<input id="min" name="" type="button"  style="height:20px;width:15px;" value="-" />
			<input id="text_box" name="" type="text" style="width:15px;" value="1" readonly/>
			<input id="add" name="" type="button" style="height:20px;width:15px;" value="+" />
			(库存:<span id="store">有货</span>)
		</div>
<if condition="$goods.store gt 0">
		<div class="buy" id="buy">
			<a onclick="shou()" href="javascript:;" ><img src="__APP__/statics/btn-fastbuy.gif"  border="0"/></a>
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<a onclick="buy()" href="javascript:;"><img src="__APP__/statics/btn-buy.gif" border="0"/></a>
		</div>
<else/>	
		<div class="buy" id="buy">
			很遗憾，没货啦！
		</div>
</if>
      </div>
	   <!--buy_zone结束-->
	</div>
	<!--sgood结束-->
</div>
</div>
<!--goods结束-->
<div class="clear"></div>

<div class="content">
        <!--左侧start-->
        <div id="intro-left">
		   <div class="other_goods">
		    <ul id="title">推荐商品</ul>
<volist name="tuijian" id="hot">
			<ul class="floor_hot">
				  <span><a href="__GROUP__/Goods/item.html?id={$hot.goods_id}"><img alt="{$hot.goods_name}" src="__APP__/{$hot.s_pic}" width="60"></a>
				  </span>
				  <span>
					  <dl id="price" style="margin-left:5px">￥{$hot.price}</dl>
					  <dl class="hot_title"><a href="__GROUP__/Goods/item.html?id={$hot.goods_id}">{$hot.goods_name}</a></dl>
					  <dl class="renqi">人气：{$hot.view_count}</dl>
				  </span>
			</ul>
</volist>
		   </div>
<volist name="ads" id="ads">
		   <div class="ads">{$ads.content}</div>
</volist>
        </div>
        
		<!--商品、评论start-->
		<div id="intro" style="border:0px;">
			<ul id="muu">
				<li><a href="#content">商品详情</a></li>
				<li><a href="#tabs3">商品参数</a></li>
				<li id="comm"><a href="#tabs2">商品评论</a></li>
				<li><a href="#tabs4">服务保障</a></li>
				<li style="float:right;"><a onclick="buy()" href="javascript:;" ><img height="23" src="__APP__/statics/add_cart.gif"></a></li>
			</ul>
			<div id="content">
			        <div id="content-box"><img src="__APP__/statics/sending.gif" height="40px" width="40px"></div>
					<!--评论开始
					<div class="com" id="com" style="border:0px;">
					<ul>
						<li><a href="#all-com">全部评价(972)</a></li>
						<li><a href="#a-com">好评(923)</a></li>
						<li><a href="#b-com">中评(45)</a></li>
						<li><a href="#c-com">差评(4)</a></li>
					</ul>
					<div id="all-com" style="text-align:center;font-size:10px;color:#666666">
					<img src="__APP__/statics/sending.gif" height="40px" width="40px"><br>
					加载中
					</div>
					<div id="a-com">2</div>
					<div id="b-com"></div>
					<div id="c-com">3</div>
				</div>
				商品、评论end-->
			</div>
			<!--商品参数-->
	<if condition="$pdt neq '' ">
			<div id="tabs3" style="margin-left:-20px">
				<table border="1" width="650px" style="border-collapse: collapse">
					<tr>
						<td colspan="2" style="background:#FAFAFA"><b>基本参数</b></td>
					</tr>
		<volist name="pdt" id="pdt">
					<tr>
						<td width="30%">{$pdt.kz_name}:</td>
						<td>{$pdt.kuozhan}</td>
					</tr>
		</volist>
				</table>
			</div>
	</if>
            <!--评论-->
			<div id="tabs2"><div id="commlist"><include file="commlist" /></div></div>
			<!--服务-->
			<div id="tabs4">{$shouhou.content}</div>
		</div>

</div>

<div class="clear"></div>
<link rel="stylesheet" type="text/css" href="__APP__/statics/css/jNotify.jquery.css" />
<script type="text/javascript" src="__APP__/statics/jNotify.jquery.js"></script>
<script type="text/javascript" src="__APP__/statics/js/re_num.js"></script>
<if condition="$user neq ' '">
<!--判断是否登录-->
<script src="__APP__/statics/js/login.js"></script>
<link href="__APP__/statics/css/login.css" rel="stylesheet" type="text/css">
</if>
<script src="__APP__/statics/jquery-ui/jquery-ui-1.9.2.custom.min.js"></script>
<script type="text/javascript"> 
$.fn.smartFloat = function() {
	var position = function(element) {
		var top = element.position().top, pos = element.css("position");
		$(window).scroll(function() {
			var scrolls = $(this).scrollTop();
			if (scrolls > top) {
				if (window.XMLHttpRequest) {
					element.css({
						position: "fixed",
						top: 4
					});	
				} else {
					element.css({
						top: scrolls
					});	
				}
			}else {
				element.css({
					position: pos,
					top: top
				});	
			}
		});
};
	return $(this).each(function() {
		position($(this));						 
	});
};
//绑定
$("#muu").smartFloat();
</script>

<script>
$(function(){
   $( "#intro" ).tabs({ active: 0 });//tab标签
   $( "#com" ).tabs({ active: 0 });//tab标签
   
   //ajax加载商品详情
   var id=$("#good_id").val();
   $("#content-box").load("__URL__/ajax_intro/?id="+id);
    
	//去除虚线
    $('a,input[type="button"],input[type="submit"]').bind('focus',function(){               
	     if(this.blur){                      
		 this.blur();                
		 };        
    });
})
</script>
<script type="text/javascript">
	//规格选择
	function changeAtt(t) {
     t.lastChild.checked='checked';
     for (var i = 0; i<t.parentNode.childNodes.length;i++) {
            if (t.parentNode.childNodes[i].className == 'cattsel') {
                   t.parentNode.childNodes[i].className = '';
            }
      }
          t.className = "cattsel";
          changePrice();
     }

     function changePrice(){
	    var q1=$("input[name='guige1']").val();
        var p1=$("input[name='guige1']:checked").val();
		var q2=$("input[name='guige2']").val();
		var p2=$("input[name='guige2']:checked").val();
		var id=$("#good_id").val();
		$(".tixing").css('display','none');
		if(p1==undefined){
		     $("#a_prop").html("已选择："+p2);
	     }else if(p2==undefined){
		     $("#a_prop").html("已选择："+p1);
		}else{
		     $("#a_prop").html("已选择："+p1+","+p2);
		}
      
	  //有两个规格
      if(q1!=undefined&&q2!=undefined){
	     if(p1!=undefined&&p2!=undefined){
					$.ajax({
					type:"POST",
					url:"__URL__/get_price",
					dataType:"json",
					data:{id:id,prop1:p1,prop2:p2},
					success:function(data){
								if(data.store>='1'){
										$("#n_price").html(data.price);
										$("#buy").html("<a onclick='shou()' href='javascript:;'><img src='__APP__/statics/btn-fastbuy.gif'  border='0'/></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a onclick='buy()' href='javascript:;'><img src='__APP__/statics/btn-buy.gif' border='0'/></a>");
										$("#store").html(data.store);
										$("#text_box").attr('maxsize',data.store);
										$("#choose_id").val(data.choose_id);
								}else{
										$("#buy").html("<font color='red'><b>很遗憾，此组合无货！</b></font>");
										$("#store").html("无货");
							    }
					}
					})
				}
		 }
          //只有一个规格
		  if((q1==undefined&&q2!=undefined&&p2!=undefined)||(q1!=undefined&&q2==undefined&&p1!=undefined)){
				$.ajax({
					type:"POST",
					url:"__URL__/get_price",
					dataType:"json",
					data:{id:id,prop1:p1,prop2:p2},
					success:function(data){
								if(data.store>='1'){
										$("#n_price").html(data.price);
										$("#buy").html("<a onclick='shou()' href='javascript:;'><img src='__APP__/statics/btn-fastbuy.gif'  border='0'/></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a onclick='buy()' href='javascript:;'><img src='__APP__/statics/btn-buy.gif' border='0'/></a>");
										$("#store").html(data.store);
										$("#text_box").attr('maxsize',data.store);
										$("#choose_id").val(data.choose_id);
								}else{
										$("#buy").html("<font color='red'><b>很遗憾，此组合无货！</b></font>");
										$("#store").html("无货");
							    }
					}
					})
		 }
		 //判断是否有值结束
		 

     }

	 function buy(){
	    var q1=$("input[name='guige1']").val();
        var p1=$("input[name='guige1']:checked").val();
		var q2=$("input[name='guige2']").val();
		var p2=$("input[name='guige2']:checked").val();
		if((q1!=undefined&&p1==undefined)||(q2!=undefined&&p2==undefined)){
	           jError("<strong>请选择规格！</strong>",{VerticalPosition : 'center',HorizontalPosition : 'center'});
			   $(".tixing").css('display','block');
		 }else{
		     addCart();
		}
	}

	function shou(){
	    var goods_id=$("#good_id").val();
		$.ajax({
		     type:"GET",
			 url:"__URL__/goods_store",
			 dataType:"json",
			 data:{'goods_id':goods_id},
			 success:function(data){
			     if(data==1){
				    		$.webox({
								height:380,
								width:400,
								bgvisibel:true,
								title:'会员登录',
								iframe:'__GROUP__/Member/slogin.html?'+Math.random
							});
				 }else if(data==2){
				    jNotify("<strong>您已经收藏过此商品！</strong>",{VerticalPosition : 'center',HorizontalPosition : 'center'});
			     }else{
			        jSuccess("<strong>收藏成功！</strong>",{VerticalPosition : 'center',HorizontalPosition : 'center'});
			     }
			 }
		})
	}

	function addCart(){
	     var product_id=$("#choose_id").val();
		 var buy_num=$("#text_box").val();
		  $.ajax({
					type:"POST",
					url:"__GROUP__/Cart/add",
					dataType:"html",
					data:{id:product_id,num:buy_num},
					success:function(data){
					      jSuccess("<strong>加入购物车成功！</strong>",{VerticalPosition : 'center',HorizontalPosition :'center'});
						  $("#cart_num").load("__URL__/updateCart");
					}
		 })
	}

	$("#min").click(function(){
	    var num=parseInt($("#text_box").val())-1;
		if(num<1){
		$("#text_box").val('1');
		}
	})
</script>

<include file="Public:footer" /> 